<?php
	include("../../app/View/Parts/left.ctp");
?>
<div class="right">
	<div class='button'><?php echo $this->Html->link('Create User', array('action' => 'add')); ?></div>
	<div class="br">&nbsp;</div>
	<table width="100%" cellspacing="1" cellpadding="10" class='grid_table'>
		<tr bgcolor="#ccc">
			<th>Sl</th>
			<th>User Name</th>
			<th>Role</th>
			<th>Created</th>
			<th>Modified</th>
			<th>Action</th>
		</tr>
	<?php
		$sl=0;
		foreach($users as $user){
			$sl ++ ;
			if($sl%2==0){
				echo '
					<tr bgcolor="#E2E2E2">
						<td>'.$sl.'</td>
						<td>'.$user['User']['username'].'</td>
						<td>'.$user['User']['role'].'</td>
						<td>'.$user['User']['created'].'</td>
						<td>'.$user['User']['modified'].'</td>
						<td>'.$this->Html->link('Edit', array('action' => 'edit', $user['User']['id'])).' | '.$this->Form->postLink('Delete', array('action' => 'delete',$user['User']['id']),array('confirm' => 'Are you sure?')).'</td>
					</tr>
				';
			}else{
				echo '
					<tr>
						<td>'.$sl.'</td>
						<td>'.$user['User']['username'].'</td>
						<td>'.$user['User']['role'].'</td>
						<td>'.$user['User']['created'].'</td>
						<td>'.$user['User']['modified'].'</td>
						<td>'.$this->Html->link('Edit', array('action' => 'edit', $user['User']['id'])).' | '.$this->Form->postLink('Delete', array('action' => 'delete',$user['User']['id']),array('confirm' => 'Are you sure?')).'</td>
					</tr>
				';
			}
		}
	?>
	</table>
</div>
<div style="clear:both;"></div>